﻿@using Cofoundry.Web.Identity;
@model ChangePasswordViewModel
@inject ICofoundryHelper Cofoundry

<h1 class="mt-3">Change Password</h1>

<div class="row mt-4 mb-5">
    <div class="col col-4">

        @if (Context.Request.Method == "POST" && ViewData.ModelState.IsValid)
        {
            <p>Your password has been updated.</p>

            <p>
                <a href="@UrlLibrary.PartnerLogin(ViewBag.ReturnUrl)">Click here to login</a>
            </p>
        }
        else
        {
            <form method="post">

                <p class="message warning">
                    You must change your password before accessing the partner area.
                </p>

                <div asp-validation-summary="ModelOnly" class="text-danger"></div>

                <div class="form-group">
                    <label asp-for="Username"></label>
                    <input asp-for="Username" class="form-control">
                    <span asp-validation-for="Username" class="text-danger"></span>
                </div>
                <div class="form-group">
                    <label asp-for="OldPassword"></label>
                    <input asp-for="OldPassword" class="form-control">
                    <span asp-validation-for="OldPassword" class="text-danger"></span>
                </div>
                <div class="form-group">
                    <label asp-for="NewPassword"></label>
                    <input asp-for="NewPassword" class="form-control">
                    <span asp-validation-for="NewPassword" class="text-danger"></span>
                </div>
                <div class="form-group">
                    <label asp-for="ConfirmNewPassword"></label>
                    <input asp-for="ConfirmNewPassword" class="form-control">
                    <span asp-validation-for="ConfirmNewPassword" class="text-danger"></span>
                </div>

                <button type="submit" class="btn btn-primary">Submit</button>

            </form>
        }
    </div>
</div>